package com.probox.common.entity.domain.product;

import java.math.BigDecimal;
import java.util.Date;

import cn.hutool.core.date.DateUtil;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;

import com.probox.common.core.enums.DataStatus;
import com.probox.common.core.enums.ProductAuditStatus;
import com.probox.common.core.enums.ProductSumbitStatus;
import com.probox.common.core.utils.money.MoneyUtils;
import com.probox.common.entity.domain.product.vo.PddGoods;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import com.baomidou.mybatisplus.annotation.*;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.probox.common.core.annotation.Excel;

/**
 * 商品信息对象 product_info
 *
 * @date 2021-05-28
 */
@Data
@Accessors(chain = true)
@TableName("product_info")
public class ProductInfo implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * $column.columnComment
     */
    //默认主键自增
    @TableId(value = "PRODUCT_UID", type = IdType.AUTO)
    private Long productUid;
    /**
     * 平台ID
     */
    //@Excel(name = "平台ID")
    //private Long platformUid;
    /**
     * 所属供应商ID
     */
    //@Excel(name = "所属供应商ID")
//    @TableField(updateStrategy = FieldStrategy.IGNORED)
    //private Long supplierUid;
    /**
     * 分类一级ID
     */
    //@Excel(name = "分类一级ID")
//    @TableField(updateStrategy = FieldStrategy.IGNORED)
    //private Long categoryUidOne;
    /**
     * 分类二级ID
     */
    //@Excel(name = "分类二级ID")
//    @TableField(updateStrategy = FieldStrategy.IGNORED)
   // private Long categoryUidTwo;
    /**
     * 分类三级ID
     */
    //@Excel(name = "分类三级ID")
//    @TableField(updateStrategy = FieldStrategy.IGNORED)
    //private Long categoryUidThree;
    /**
     * 品牌ID
     */
    //@Excel(name = "品牌ID")
//    @TableField(updateStrategy = FieldStrategy.IGNORED)
    //private Long brandUid;
    /**
     * 商品名称
     */
    @Excel(name = "商品名称")
    private String productName;
    /**
     * 商品编码
     */
    @Excel(name = "商品编码")
    private String productNo;
    /**
     * 商品重量
     */
    //@Excel(name = "商品重量")
    //private String productWeight;
    /**
     * 商品单位
     */
   // @Excel(name = "商品单位")
   // private Long unitUid;
    /**
     * 商品条码
     */
   // @Excel(name = "商品条码")
    //private String productBarcode;
    /**
     * 供货价
     */
    @Excel(name = "买断积分")
    private Integer costPrice;

    /**
     * 预警数量
     */
    //@Excel(name = "预警数量")
    //private Long warningNumber;
    /**
     * 商品总库存
     */
    //@Excel(name = "商品总库存")
   // private Long stockNumber;
    /**
     * 商品卖点
     */

    /**
     * 商品轮播图
     */
    //@Excel(name = "商品轮播图")
    //private String carouselImg;
    /**
     * 商品轮播视频
     */
    //@Excel(name = "商品轮播视频")
    //private String carouselVedio;
    /**
     * 商品详情图片
     */
    //@Excel(name = "商品详情图片")
    //private String detailImg;
    /**
     * 商品详情视频
     */
    //@Excel(name = "商品详情视频")
    //private String detailVedio;
    /**
     * 横向图
     */
    //@Excel(name = "横向图")
    //private String bannerImg;
    /**
     * 商品分享图片
     */
    //@Excel(name = "商品分享图片")
   // private String shareImg;
    /**
     * 商品分享文案
     */
    //@Excel(name = "商品分享文案")
   // private String shareTxt;
    /**
     * 数据状态(0下架/1上架/-1删除)
     */
    @Excel(name = "数据状态(0下架/1上架/-1删除)")
    private String dataStatus;
    /**
     * 申请状态
     */
    @Excel(name = "申请状态")
    private String sumbitStatus;
    /**
     * 审核状态
     */
    @Excel(name = "审核状态")
    private String auditStatus;
    /**
     * 上架时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "上架时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date publishTime;
    /**
     * 排序
     */
    @Excel(name = "排序")
    private Long dataPriority;
    /**
     * 创建人ID
     */
    @Excel(name = "创建人ID")
    private Long createUid;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /**
     * 更新人ID
     */
    @Excel(name = "更新人ID")
    private Long updateUid;
    /**
     * 更新时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    /**
     * 提交审核人ID
     */
    @Excel(name = "提交审核人ID")
    private Long submitUid;
    /**
     * 提交审核时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "提交审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date submitTime;
    /**
     * 审核人ID
     */
    @Excel(name = "审核人ID")
    private Long auditUid;
    /**
     * 审核人时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "审核人时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;
    /**
     * 商品二维码图片地址
     */
    //@Excel(name = "商品二维码图片地址")
   // private String codeAddress;
    /**
     * 商品链接
     */
    //@Excel(name = "商品链接")
    //private String codeUrl;
    /**
     * 产地省份代码
     */
    //@Excel(name = "产地省份代码")
    //private String productPlaceProvinceCode;
    /**
     * 产地省份名称
     */
    //@Excel(name = "产地省份名称")
    //private String productPlaceProvinceName;
    /**
     * 产地城市代码
     */
    //@Excel(name = "产地城市代码")
    //private String productPlaceCityCode;
    /**
     * 产地城市名称
     */
   // @Excel(name = "产地城市名称")
    //private String productPlaceCityName;
    /**
     * 产地区县代码
     */
   // @Excel(name = "产地区县代码")
   // private String productPlaceAreaCode;
    /**
     * 产地区县名称
     */
    //@Excel(name = "产地区县名称")
   // private String productPlaceAreaName;

    @Excel(name = "创建人名称")
    private String createName;

    @Excel(name = "更新人名称")
    private String updateName;

    @Excel(name = "提交人名称")
    private String submitName;

    @Excel(name = "审核人名称")
    private String auditName;
    //private String productDesc;
    // h5地址
   // private String hfiveCodeAddress;
    // 测试商品id
    //private Long pddUid;

    //@Excel(name = "是否有SKU")
    //private String haveSku;

    /**
     * 是否分类推荐
     */
    //private String isCategoryRecommend;

    private Long categoryUid;
    private Long majorUidOne;
    private Long majorUidTwo;
    private Long majorUidThree;
    private Integer pages;
    private Integer numbers;
    private Integer jifen;
    private Boolean isTraditionDuplicate;
    private Boolean isAigcDuplicate;
    private String showFile;
    private String downloadFile;

    private Integer downloadCount;

    public ProductInfo() {

    }

    public ProductInfo(PddGoods goods, Long userId, String userName, Long platformUid, Long cateUid) {

        this.createUid = userId;
        this.createName = userName;
        this.createTime = DateUtil.date();
        this.updateUid = userId;
        this.updateName = userName;
        this.updateTime = this.createTime;
        //this.platformUid = platformUid;

        //this.costPrice = goods.getMinGroupPrice();

        this.productName = goods.getGoodsName();
        this.dataStatus = DataStatus.valid.getKey();
        this.auditStatus = ProductAuditStatus.pass.getKey();
        this.sumbitStatus = ProductSumbitStatus.normal.getKey();

        this.productNo = String.valueOf(goods.getGoodsId());

    }



    private String lunwenType;

    @TableField(exist = false)
    private String orderType;
}
